package handler

import (
	"app/clientutils/commonfunc"
	pb "app/services/hello/proto"
	"context"
	"github.com/gin-gonic/gin"
)

type Say struct {
	Srv pb.SayService
}

func (s *Say) Hello(ctx *gin.Context) {
	name := ctx.DefaultQuery("name","hsk")
	resp, err := s.Srv.Hello(context.TODO(),&pb.Request{Name:name})
	if err != nil {
		commonfunc.ReqFail(ctx,err)
		return
	}
	commonfunc.ReqSuccess(ctx,resp)
}
